package cn.lix.sc.rpc.server.config;

import cn.lix.sc.rpc.server.handler.RequestHandlerInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

/**
 * rpc服务提供端配置
 * @date 2021/4/27
 * @author lix
 * @email sclx1220@163.com
 */
//@Configuration
public class RequestInterceptorConfig extends WebMvcConfigurationSupport {

    @Override
    protected void addInterceptors(InterceptorRegistry registry) {
        // 将上面自定义好的拦截器添加进去
        registry.addInterceptor(new RequestHandlerInterceptor()).addPathPatterns("/**");
        super.addInterceptors(registry);
    }

}
